package cn.ipanel.bigdata.job

import cn.ipanel.bigdata.boot.Job
import cn.ipanel.bigdata.boot.date.{Day, Date}
import cn.ipanel.bigdata.dw.Const
import cn.ipanel.bigdata.dw.dim.AbsDimHive

/**
 * Author: lzz
 * Date: 2022/3/30 9:15
 */
package object dim {

  abstract class AbsDimJob extends Job with Const {

    lazy val yyyyMMdd: String = getDateFromParam
    lazy val day: Day = if (yyyyMMdd == null) Date.asYesterday else Day(yyyyMMdd)

    def optTargetTable: AbsDimHive

    override def onPrepare(): Unit = optTargetTable.drop(day)
  }
}